// import { Button, DatePicker, Form, Icon, Input, Spin, Table } from 'antd';
import { ColumnProps } from 'antd/lib/table';
import React from 'react';
import moment from 'moment';
// import { getColumnSearchProps } from '@/pages/finance/withdraw/utils';
// import { checkPermission } from '@/utils/resolvePermission';

interface StateType {
  [propName: string]: any;
}
export const getColumns = (self: any) => {
  const statusMap = {
    0: '处理中',
    1: '成功',
    2: '失败',
  };
  const orderTypeMap = {
    1: '存款',
    2: '提现',
    3: '转账',
    4: '红利',
    5: '返水',
    6: '提现退回',
    10: '减币',
    11: '上分',
    14: '加币',
  };

  const columns: ColumnProps<StateType>[] = [
    {
      title: '交易时间',
      dataIndex: 'createTime',
      width: 130,
      render: time => time && <span>{moment(time).format('YY-MM-DD HH:mm:ss')}</span>,
    },
    {
      title: '交易单号',
      dataIndex: 'orderId',
      width: 130,
    },
    {
      title: '类型',
      dataIndex: 'orderType',
      width: 150,
      render: orderType => <span>{orderTypeMap[orderType]}</span>,
    },
    {
      title: '细分类型',
      dataIndex: 'subType',
      width: 130,
    },
    {
      title: '金额',
      dataIndex: 'amount',
      width: 100,
    },
    {
      title: '手续费',
      dataIndex: 'fee',
      width: 150,
    },
    {
      title: '实际到账',
      dataIndex: 'reallyAmount',
      width: 130,
    },
    {
      title: '操作动作',
      width: 130,
      render: (text: any, rowData: any) => (
        <span>{`${orderTypeMap[rowData.orderType]}(${rowData.remark})`}</span>
      ),
    },
    {
      title: '状态',
      dataIndex: 'status',
      width: 100,
      render: status => <span>{statusMap[status]}</span>,
    },
  ];
  return columns;
};
